<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>relative练习二</title>
  </head>
  <style>
    /* 
    让图片居中显示
      1.图片宽度：1280*365
      2.向左移：（1280-800）/2=240
     */
    .content {
      width: 800px;
      background-color: pink;
      height: 365px;
      margin: 20px auto;
      overflow: hidden;
    }

    .content>img {
      position: relative;
      left: -240px;
      top: 0px;
    }
  </style>

  <body>
    <div class="content">
      <img src="../img/meng.png" alt="">
    </div>
  </body>

</html>